package demo.propertySupport;

import java.beans.PropertyVetoException;

/**
 * description: <br>
 * createTime: 2021/1/13 16:56 <br>
 *
 * @author zzh
 */
public class Test {

    public static void main(String[] args) throws PropertyVetoException {
        ProBean pb=new ProBean("lee");
        NameListener lis=new NameListener();
        pb.addPropertyChangeListener(lis);
//        pb.addVetoableChangeListener(lis);
        try {
            pb.setName("fred");
            System.out.println("------------------");
            pb.setName("frank");
            System.out.println("------------------");
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        System.out.println(pb.getName());
    }
}
